import sys
from PyQt5.QtWidgets import QApplication, QPushButton
class ToggleButton(QPushButton):
    def __init__(self, parent=None):
        super(ToggleButton, self).__init__(parent)
        self.setCheckable(True)
        self.setChecked(False)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    button = ToggleButton()
    button.resize(100, 50)
    button.show()
    sys.exit(app.exec_())